<!--
 * @Author:
 * @Date: 2022-08-23 17:31:12
 * @LastEditors:
 * @LastEditTime: 2022-09-02 18:57:32
 * @FilePath: \imechos-admin\src\views\anchorManagement\anchorInterview.vue
 * @Description:
 *
 * Copyright (c) 2022 by  , All Rights Reserved.
-->
<template>
    <div>
        <div class="flex justify-center mt-20">
            <el-input v-model="number" placeholder="请输入用户ID" size="normal" clearable class="mr-4" style="width: 280px;"></el-input>
            <el-button type="primary" size="default" @click="search">开始面试</el-button>
        </div>
    </div>
</template>

<script>
import { interviewStart } from '@/api/sys/anchorList'
import interviewDetails from './interviewDetails'
export default {
    name: 'anchorInterview',
    components: {
        interviewDetails
    },
    data() {
        return {
            number: undefined,
            showDetails: false,
            propData: undefined
        }
    },
    methods: {
        search() {
            if(!this.number) {
                this.$message({
                    type: 'warning',
                    message: '请输入用户ID'
                })
                return false
            }
            // this.$router.push({
            //     path: 'interviewDetails',
            //     query: {
            //         id: this.number
            //     }
            // })面试状态
            this.interviewStart(this.number)
        },
        interviewStart(user_id) {
            interviewStart({
                user_id: user_id
            }).then(res => {
                if(res.code === 200) {
                    this.$router.push({
                        path: 'interviewDetails',
                        query: {
                            id: user_id
                        }
                    })
                }
            })
        }
    },

}
</script>

<style>

</style>
